package com.wn.controller;

import com.wn.bean.House;
import com.wn.bean.R;
import com.wn.service.HouseService;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yellow Docter
 * @date 2022 -07-15
 * @desc
 */
@RestController
@RequestMapping("house")
public class HouseController {

    @Autowired
    private HouseService houseService;

    @RequestMapping("list")
    public R findHouses(Integer currentPage,Integer pageSize){

        R r = houseService.listHouse(currentPage,pageSize);

        return r;
    }

    @PutMapping
    public R findHouses(@RequestBody House house){
        return  houseService.update(house);
    }
}


